package org.bronycorps.mlptss.domain.model;

import org.bronycorps.mlptss.utils.AnimationCache;
import org.bronycorps.mlptss.utils.DrawableAnimation;

public class SpecialBullet extends AbstractActorModel {

	private final float angle;
	private final SpecialBulletType bulletType;
	private final Player owner;

	public SpecialBullet(Player owner, SpecialBulletType bulletType) {
		super();
		this.owner = owner;
		this.bulletType = bulletType;
		this.angle = owner.getAngle();
	}

	public Boolean explodeOnHit() {
		return this.bulletType.isExploseOnHit();
	}

	public Boolean followDirection() {
		return this.bulletType.isFollowDirection();
	}

	public float getAngle() {
		return this.angle;
	}

	public DrawableAnimation getAnimation() {
		return AnimationCache.getInstance().get(
				this.bulletType.getAnimationName());
	}

	public float getDuration() {
		return this.bulletType.getLifeDuration();
	}

	@Override
	public int getLife() {
		return 0;
	}

	public Player getOwner() {
		return this.owner;
	}

	public String getScriptName() {
		return this.bulletType.getScriptName();
	}
}
